package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementPortMtnPhyMapper;
import com.ruoyi.net.domain.ElementPortMtnPhy;
import com.ruoyi.net.service.IElementPortMtnPhyService;

/**
 * 网元-接口-mtnphy接口Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementPortMtnPhyServiceImpl implements IElementPortMtnPhyService 
{
    @Autowired
    private ElementPortMtnPhyMapper elementPortMtnPhyMapper;

    /**
     * 查询网元-接口-mtnphy接口
     * 
     * @param id 网元-接口-mtnphy接口主键
     * @return 网元-接口-mtnphy接口
     */
    @Override
    public ElementPortMtnPhy selectElementPortMtnPhyById(String id)
    {
        return elementPortMtnPhyMapper.selectElementPortMtnPhyById(id);
    }

    /**
     * 查询网元-接口-mtnphy接口列表
     * 
     * @param elementPortMtnPhy 网元-接口-mtnphy接口
     * @return 网元-接口-mtnphy接口
     */
    @Override
    public List<ElementPortMtnPhy> selectElementPortMtnPhyList(ElementPortMtnPhy elementPortMtnPhy)
    {
        return elementPortMtnPhyMapper.selectElementPortMtnPhyList(elementPortMtnPhy);
    }

    /**
     * 新增网元-接口-mtnphy接口
     * 
     * @param elementPortMtnPhy 网元-接口-mtnphy接口
     * @return 结果
     */
    @Override
    public int insertElementPortMtnPhy(ElementPortMtnPhy elementPortMtnPhy)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementPortMtnPhy.getId())) {
            elementPortMtnPhy.setId(uuid);
        }
        elementPortMtnPhy.setCreateBy(SecurityUtils.getUsername());
        elementPortMtnPhy.setCreateTime(DateUtils.getNowDate());
        elementPortMtnPhy.setUpdateBy(SecurityUtils.getUsername());
        elementPortMtnPhy.setUpdateTime(DateUtils.getNowDate());
        return elementPortMtnPhyMapper.insertElementPortMtnPhy(elementPortMtnPhy);
    }

    /**
     * 修改网元-接口-mtnphy接口
     * 
     * @param elementPortMtnPhy 网元-接口-mtnphy接口
     * @return 结果
     */
    @Override
    public int updateElementPortMtnPhy(ElementPortMtnPhy elementPortMtnPhy)
    {
        elementPortMtnPhy.setUpdateBy(SecurityUtils.getUsername());
        elementPortMtnPhy.setUpdateTime(DateUtils.getNowDate());
        return elementPortMtnPhyMapper.updateElementPortMtnPhy(elementPortMtnPhy);
    }

    /**
     * 批量删除网元-接口-mtnphy接口
     * 
     * @param ids 需要删除的网元-接口-mtnphy接口主键
     * @return 结果
     */
    @Override
    public int deleteElementPortMtnPhyByIds(String[] ids)
    {
        return elementPortMtnPhyMapper.deleteElementPortMtnPhyByIds(ids);
    }

    /**
     * 删除网元-接口-mtnphy接口信息
     * 
     * @param id 网元-接口-mtnphy接口主键
     * @return 结果
     */
    @Override
    public int deleteElementPortMtnPhyById(String id)
    {
        return elementPortMtnPhyMapper.deleteElementPortMtnPhyById(id);
    }
}
